const swaggerJSDoc = require('swagger-jsdoc');
const swaggerDefinition = {
  openapi: '3.1.0',
  info: {
    description: 'vDrag数据库连接器接口文档',
    version: '1.0.0',
    title: 'vDrag connector',
  },
  servers: [
    {
      url: 'http://localhost:4322/api',
    }
  ],
  components: {
    securitySchemes: {
      Authorization: {
        type: 'apiKey',
        in: 'header',
        name: 'Authorization',
        description: ''
      }
    },
  }

};
const options = {
  swaggerDefinition,
  // 写有注解的router的存放地址(当你新增swagger时文档里没显示出来的话那么就是这边地址没有加进去)
  routers: ['./routes/*.js'], // routes下所有的js文件和routes/image下所有js文件
  docsRoot: './docs',
  apis: ['./docs/*.yml']
};
const swaggerSpec = swaggerJSDoc(options);
module.exports = {
  swaggerSpec,
  config: options
};